import React, { useState } from "react";

const FileUpload = ({ onFileChange }) => {
  const [file, setFile] = useState(null);

  const handleFileChange = (e) => {
    const selectedFile = e.target.files[0];
    setFile(selectedFile);
    onFileChange(selectedFile);
  };

  return (
    <input type="file" onChange={handleFileChange} />
  );
};

export default FileUpload;